﻿@using PagedList.Mvc;
@using PagedList;
@using TestOnlineProject.Models.Entities;
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="site_map">
    @Html.ActionLink("Home", "Index", "Home") / @Html.ActionLink("Subjects", "Index", "Subject")
    / @Html.ActionLink((ViewBag.Subject as Subject).Code, "Details", "Subject", new { id = (ViewBag.Subject as Subject).SubjectId }, null)
    / Participants</div>
<br />
<div class="main_nav">
    <span><a href="@Url.Content("~/Subject/Details")?id=@ViewBag.Subject.SubjectId">
        <img src="@Url.Content("~/Images/back button.png")" style="height:30px"/></a>
    </span><span style="float: right">
               @Html.ActionLink("Sections", "Index", "Section", new { subjectId =ViewBag.Subject.SubjectId }, new { })
               |
               @Html.ActionLink("Questions", "Index", "Question", new { subjectId = ViewBag.Subject.SubjectId }, new { })
               |
               @Html.ActionLink("Tests", "Index", "Test", new { subjectId = ViewBag.Subject.SubjectId }, new { })
               |
               @Html.ActionLink("Discussions", "Index", "Discussion", new { subjectId = ViewBag.Subject.SubjectId }, new { })
           </span>
</div>
<br />
<div class="search_content">
    @using (Ajax.BeginForm("Index", "User", new AjaxOptions
    {
        InsertionMode = InsertionMode.Replace,
        HttpMethod = "GET",
        UpdateTargetId = "unobtrusive",
    }, new { @class = "form-inline" }))
    {
        <input type="hidden" value="@ViewBag.SubjectId" name="subjectId" />
        @Html.TextBox("keyWord", "", new { placeholder = "Full Name or Username" })
        <button type="submit" value="Search" class="btn" style="width: 80px">
            Search</button>
        @Html.ActionLink("Reload", "Index", "Participant", new { subjectId = @ViewBag.SubjectId }, new { @class = "btn", style = "width:54px" })
    }
</div>
<br />
@{
    if (HttpContext.Current.User.IsInRole("1"))
    {
        <div>
            @Html.ActionLink("Create Participant", "Create", new {subjectId = @ViewBag.SubjectId}, new {@class = "btn"})
            <span>@Html.ActionLink("Import Participants", "Import", "Participant", null, new { @class = "btn" })</span>
        </div>
        <br />
    }
}
<div id="unobtrusive">
    @Html.Partial("_List")
</div>
